package com.lemon.springcloudstreamyuumi.service.impl;

import com.lemon.springcloudstreamyuumi.service.IMessageConsumer;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Service;

/**
 * @program: SpringBootZoo
 * @author: Mr.Young
 * @create: 2021/4/10 23:33
 **/

@EnableBinding(Sink.class)
public class MessageConsumerImpl implements IMessageConsumer {

    @StreamListener(Sink.INPUT)
    @Override
    public void getMessage(Message<String> message) {
        System.out.println("消费****。消息："+message.getPayload());
    }
}
